<style>
	.logo_title{
		font-size: 25px;
		color:#31b9f0;
		font-weight: bold;
		text-shadow:3px 2px 6px #b7d2ff;
	}
</style>
<div data-options="region:'north',title:'',split:true,hideCollapsedContent:false" class="north_title">

	<table style="width:100%;cellspacing:0px;cellpadding:0px;border:0;align:'center'">
		<tbody>
			<tr height="50">
				<td width="300" align="center">
					<table>
						<tr>
							<td>
								<img src="__PUBLIC__/images/logo_title.png" height="50px" alt="logo" />
							</td>
							<td class="logo_title">
								定额工时管理系统
							</td>
						</tr>
					</table>

				</td>
				<td valign="middle" align="center">
							<span style="font-size:18pt;font-family:华文隶书,黑体,宋体,华文琥珀,隶书;color:#31b9f0;text-shadow:3px 2px 6px #b7d2ff;">{$Think.config.CONPANY}
					</span>&nbsp;<b style="font-size:11pt;font-weight:bold;color:#31b9f0;text-shadow:3px 2px 6px #b7d2ff;">{$Think.config.APPNAME}&nbsp;{$Think.config.APPVERSION}</b>

					<br><b style="color:#31b9f0;">『 {$Think.config.APPURL},&nbsp; {$Think.config.APPVERSION} 』<b>

    </b></b></font></font>
				</td>
				<td style="width: 300px;valign:'top';align:'center">
					<table style="width:100%;cellspacing:0px;cellpadding:0px;border:'0px';align:'center'">
						<tbody>

							<!--通过session进行判断-->
							<if condition="!empty($_SESSION[C('USER_AUTH_KEY')])">
								<tr>
									<td rowspan="2">

									<if condition="$_SESSION['avatar']==''">
										<img src="__PUBLIC__/images/avata.png" class="account-avator-bg easyui-tooltip" title="点击修改用户信息" onclick="showUser()" style="width:40px;height: 40px;"/> 
										<else />
										 <img src="__PUBLIC__/{$_SESSION['avatar']}" class="account-avator-bg  easyui-tooltip" title="点击修改用户信息" onclick="showUser()" style="width:40px;height: 40px;"/>
										</if>


									</td>
									<td style="color:#0E2D5F;font-size: 12px;">

										<a href="javascript:void(0)" id="mb" class="easyui-menubutton"
										   data-options="menu:'#mmss',iconCls:'icon-standard-user-suit'">权限</a>
										<div id="mmss" style="width:150px;">

											<volist name="zname" id="vo">



												<div data-options="iconCls:'icon-standard-user-green'">{$vo}</div>
											</volist>
										</div>

										<!--【{$_SESSION['zname']}:{$_SESSION[ 'unickname']}| IP:{$_SERVER[ "REMOTE_ADDR"]}】-->
										【{$_SESSION[ 'unickname']}| IP:{$_SERVER[ "REMOTE_ADDR"]}】



									</td>
								</tr>
								<tr>
									<td>
										
										<a  href="#" class="easyui-linkbutton" data-options="iconCls:'icon-standard-lock-edit',plain:true" onclick='changePW_show()'>修改密码</a>  

									
										<a  href="#" class="easyui-linkbutton" data-options="iconCls:'icon-standard-door-out',plain:true" onclick='loginout_show()'>退出系统</a> 
									</td>
								</tr>
								<else/>
								<tr>
									<td>
										<a class='easyui-linkbutton' plain='true' iconCls='icon-standard-house-go' href='#' onclick='login_show()'><font style="color:#0E2D5F">登录系统</font></a>

									</td>
								</tr>
								<tr>

									<td>
										<a class='easyui-linkbutton' plain='true' iconCls='icon-standard-user-add' href='#' onclick='regedit_show()'><font style="color:#0E2D5F">注册账户</font></a>

									</td>

								</tr>

							</if>
						</tbody>
					</table>
				</td>
			</tr>
		</tbody>
	</table>

</div>
<script type="text/javascript">
	function loginout_show(){    
	$('#loginout').window('open');  // open a window   
}
/**
 * [loginout 退出登录实现]
 * @return {[type]} [description]
 */
function loginout(){
	$('#loginoutForm').form('submit',{
			url:'__APP__/Admin/Login/logout',
			success:function(data){
				var data = eval('(' + data + ')');
				if(data.status==1){
					$('#loginout').dialog('close');
					$.messager.alert('登出', data.mes, 'info');
					window.location.reload();
				}else{
					$.messager.alert('登出', data.mes, 'info');
				}
			}
		});
	}
//修改密码
function changePW_show(){    
	$('#changePW').window('open');  // open a window   
}
	//更改密码
function changePW(){
if($('#xpassword1').val()!=$('#xpassword2').val()){
	$.messager.alert("密码不正确", "两次输入的新密码不一样！", "info");
}else{
		$('#changePWForm').form('submit',{
			
			url:'__APP__/Admin/Login/changepw',
			success:function(data){
				var data = eval('(' + data + ')');
				if(data.status==1){
					$.messager.alert('修改密码', data.mes, 'info');
					$('#changePW').dialog('close');	
				}else{
					$.messager.alert('修改密码', data.mes, 'info');
				}			
			}
		});
}

	}
//
function login_show(){    
	$('#login').window('open');  // open a window   
}
function login(){
$('#loginForm').form('submit',{
		url:'__APP__/Admin/Login/checkLogin',
		success:function(data){
		var data = eval('(' + data + ')');
		if(data.status==1){
			$.messager.alert('登录', data, data.mes);
		}else{
			$.messager.alert('登录失败', data, data.mes);
		}
		
		$('#login').dialog('close');

		window.location.reload(); 
		
		}
	});
	
	}
function regedit_show(){    

	$('#regedit').window('open');  // open a window   
}
/**
 * [showUser 显示用户页面tab]
 * @return {[type]} [description]
 */
function showUser(){


var id="{$_SESSION[ 'uid']}";

if(id!='' & id!=107){

    if ($('#tab').tabs('exists', '用户信息')){
                    $('#tab').tabs('select', '用户信息');    
                } else {
  	$('#tab').tabs('add',{ 
    title:'用户信息', 
    iconCls:'icon-standard-zoom',  
    fit:true,
    href:APP+'/Admin/User/info',
    loadingMessage:'用户信息正在载进中…',
    closable:true  
});

    }



}else{
$.messager.alert('错误', '没有登录，无法获取用户信息！', 'info');
}
}








</script>
